<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title></title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
		<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
		<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
		<script src="__PUBLIC__/static/layui/layui.all.js"></script>
	</head>

	<body>
		<!--新增弹出框开始-->
		<div class="maskbox">
			<form class="form form-horizontal" id="form-admin-add" method="post">
				<div class="shxx_row clearfix">
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="title" id="title" class="chax_input chax_input2" placeholder="标题" style="width: 350px; margin-top: 20px;">
							</div>
						</div>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<textarea name="content" id="content" style="width: 400px; height: 120px;"></textarea>
							</div>
						</div>
					</div>
				</div>
				<div class="add_btnbox">
					<button type="button" class="add_btn_yes" id="tijiao">确定</button>
				</div>
			</form>
		</div>
	</body>

</html>
<script>
	$('#tijiao').click(function() {
		var title = $('#title').val();
		var content = $('#content').val();
		
		
		if(title.trim() ==""){
			layer.msg('标题不能为空');
			return;
		}
		if(content.trim() ==""){
			layer.msg('内容不能为空');
			return;
		}
		 
		
		
		$.ajax({
			type: 'post',
			data: {
				title: $('#title').val(),
				content: $('#content').val()
			},
			url: "{:url('helps/notice_add')}",
			success: function(data) {
				if(data.code == 200) {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					}, function() {
						window.parent.location.reload();
					});
				} else {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					});
				}

			}
		});
	});
</script>